<%@ Page PathInChannel="course/view/{ID}{Ext}" %>
<%
	if (!Request.UserAgent.ToLower().Contains("micromessenger"))
		Response.Redirect(<%=BuildUrl("index")%>);
%>
<!doctype html>
<html lang="<%=PageLang%>"<%If PageLang == "UYG"%> class="rtl"<%EndIf%>>
<head>
<ali:List ID="Course" Mark="Course" Object="Course" Page="1" PageSize="1" Condition="Condition()" />
<ali:Get ID="Teacher" Mark="Course" Object="Teacher" Guid="Course[TeacherID]" />
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
<title><%=Course[Name]%></title>
<link rel="stylesheet" href="<%=CommonPath%>aliui/skin/default/ali.mobile.css">
<link rel="stylesheet" href="<%=CommonSkinPath%>css/common.css">
<link rel="stylesheet" href="<%=SkinPath%>css/common.css">
<script language="c#" runat="server">
protected int counter = 0;
protected bool CheckChapter(object isChapter)
{
	if (Convert.ToBoolean(isChapter))
	{
		counter++;
		return true;
	}
	else
	{
		return false;
	}
}
protected string Condition()
{
	String id = Request.QueryString["ID"];
	if (System.Text.RegularExpressions.Regex.IsMatch(id, @"^\d+$"))
		return AliCMS.CourseModule.Alias.Course.InnerID + "=" + id;
	else
		return AliCMS.CourseModule.Alias.Course.ID + "=" + id;
}
</script>
</head>
<body>
<div class="page flex" id="course-view" data-id="<%=Course[InnerID]%>" data-guid="<%=Course[ID]%>" data-name="<%=Course[Name]%>" data-picture="<%=Course[Picture]%>" data-price="<%=Course[Price]%>" data-time-unit="<%=Course[TimeUnit]%>" data-time-amount="<%=Course[TimeAmount]%>" data-is-member-free="<%=Convert.ToString(Course[IsMemberFree]).ToLower()%>" data-media-type="<%=Course[MediaType]%>"<%If !Convert.IsDBNull(Course[TeacherID])%> data-teacher-id="<%=Teacher[ID]%>" data-teacher-name="<%=Teacher[Name]%>" data-teacher-head="<%=Teacher[UserHead]%>" data-teacher-commision="<%=Teacher[Commision]%>"<%EndIf%> data-path="<%=BuildUrl("course/ajax_view")%>" data-get-lesson="<%=BuildUrl("course/ajax_view_get_lesson")%>" data-get-ask-list="<%=BuildUrl("course/ajax_view_get_ask_list")%>" data-text-path="<%=BuildUrl("lesson/text")%>" data-pay-return-url-path="<%=BuildUrl(null, "course/pay_return_url", "OrderID={OrderID}")%>" data-wxpp-app-id="<%=Manager.Site[AliCMS.SystemModule.Alias.InstanceConfig.WxppAppID + PageLang]%>" data-expired-time="{days}天后过期" data-not-login="您还未登陆！" data-not-buy="您还没购买！" data-collect="收藏" data-already-collect="已收藏" data-continue="继续学习" data-lesson-no="第{1}课" data-finish="学完了" data-finished="已学完" data-confirm-finish="确认学完了吗？" data-need-check="发表成功！请等待审核..." data-out-of-free="试用完毕！" data-save-image="长按上图保存图片！" data-share="点击图片分享" data-sum-incorrect="金额不正确！">
	<!-- start="标题栏" -->
	<div class="titlebar"><a class="back"></a><h1><%=Course[Name]%></h1><a class="share"></a></div>
	<!-- end="标题栏" -->
	
	<!-- start="内容" -->
	<div id="course-view-body">
		<!-- start="头部" -->
		<div id="course-view-head">
			<div id="player" style="background-image:url(<%=Course[Picture]%>)"></div>
			<h1><%=Course[Name]%></h1>
			<ul>
				<li>
					<label>价 格：</label>
					<em>
						<%If Convert.ToDecimal(Course[Price]) == 0%>
							免费
						<%Else%>
							<%If Convert.ToString(Course[TimeUnit]) == "MONTH"%>
								<%=Course[Price]%> 元/<%=Convert.ToInt32(Course[TimeAmount]) == 1 ? "" : Convert.ToString(Course[TimeAmount])%>月
							<%ElseIf Convert.ToString(Course[TimeUnit]) == "SEASON"%>
								<%=Course[Price]%> 元/<%=Convert.ToInt32(Course[TimeAmount]) == 1 ? "" : Convert.ToString(Course[TimeAmount])%>季
							<%ElseIf Convert.ToString(Course[TimeUnit]) == "HALF_YEAR"%>
								<%=Course[Price]%> 元/<%=Convert.ToInt32(Course[TimeAmount]) == 1 ? "" : Convert.ToString(Course[TimeAmount])%>半年
							<%ElseIf Convert.ToString(Course[TimeUnit]) == "YEAR"%>
								<%=Course[Price]%> 元/<%=Convert.ToInt32(Course[TimeAmount]) == 1 ? "" : Convert.ToString(Course[TimeAmount])%>年
							<%Else%>
								<%=Course[Price]%> 元
							<%EndIf%>
						<%EndIf%>
					</em>
				</li>
				<li id="expired-time" style="display:none"><label>过期时间：</label><span></span></li>
			</ul>
		</div>
		<!-- end="头部" -->

		<!-- start="指标区域"-->
		<ul id="course-view-count">
			<li><em><%=Course[HitCount]%></em><span>人气</span></li>
			<li><em><%=Course[CollectCount]%></em><span>收藏</span></li>
			<li><em>0</em><span>评价</span></li>
			<li><em><%=Course[SaleCount]%></em><span>销量</span></li>
		</ul>
		<!-- end="指标区域" -->

		<!-- start="目录、详情、评论" -->
		<div class="tab2 margin1">
			<h1 class="tab2-bar"><a class="active">目录</a><a>详情</a><a>评论</a></h1>
			<div class="tab2-content">
				<!-- start="目录" -->
				<dl id="course-view-lesson-list" class="active">
					<ali:List Mark="Course" Object="Lesson" Condition="CourseID=Course[ID]">
						<ali:Record>
							<%If CheckChapter(IsChapter)%>
								<dt><%=Name%></dt>
							<%Else%>
								<dd data-id="<%=InnerID%>"><i><%=Index - (counter - 1)%>.</i><%If Convert.ToInt32(FreeDuration) > 0%><b>免费</b><%EndIf%><label><%=Name%></label><%If Convert.ToString(Course[MediaType]) != "TEXT"%><span><%=Convert.ToInt32(Duration)/60%>:<%=Convert.ToInt32(Duration)%60%></span><%EndIf%></dd>
							<%EndIf%>
						</ali:Record>
					</ali:List>
				</dl>
				<!-- end="目录" -->
				
				<!-- start="详情" -->
				<div>
					<!-- start="教师" -->
					<%If !Convert.IsDBNull(Course[TeacherID])%>
						<dl id="course-view-teacher">
							<dt><img src="<%=Teacher[Thumbnail]%>"></dt>
							<dd>
								<p><label>教师：</label><span><%=Teacher[Name]%></span></p>
								<p><label>人气：</label><span><%=Teacher[HitCount]%></span></p>
								<p><a href="<%=BuildUrl(null, "teacher/view", "ID=" + Teacher[InnerID])%>">查看更多...</a></p>
							</dd>
						</dl>
					<%EndIf%>
					<!-- end="教师" -->
					
					<!-- start="课件信息" -->
					<dl id="course-view-lesson-info">
						<dt></dt>
						<dd></dd>
					</dl>
					<!-- end="课件信息" -->
					
					<!-- start="课程介绍" -->
					<dl id="course-view-desc">
						<dt>课程介绍</dt>
						<dd><%=Course[Description]%></dd>
					</dl>
					<!-- end="课程介绍" -->
				</div>
				<!-- end="详情" -->

				<!-- start="评论" -->
				<div>
					<form id="course-view-ask"><textarea name="Content" placeholder="发表评论吧"></textarea><input type="submit" value="发送" class="disabled" disabled></form>
					
					<!-- start="列表" -->
					<div class="list11 margin1">
						<h1>评论列表</h1>
						<p>没有任何评论</p>
					</div>
					<!-- end="列表" -->
				</div>
				<!-- end="评论" -->
			</div>
		</div>
		<!-- end="目录、详情、评论" -->
	</div>
	<!-- end="内容" -->
	<!-- start="脚注" -->
	<div id="course-view-footer">
		<a id="wait">请稍等...</a>
		<a id="login">您还没有登录，请马上登录</a>
		<a id="buy">立即购买</a>
		<a id="promotion"><p><strong>离促销结束时间</strong><span><b>00</b>:<b>00</b>:<b>00</b>:<b>00</b></span></p><i><em>0.00</em><b>立即购买</b></i></a>
		<a id="member-buy"><p><em>0.00</em><b>会员已优惠</b></p><i><em>0.00</em><b>立即购买</b></i></a>
		<a id="home" href="<%=BuildUrl("index")%>">首页</a>
		<!--<a id="service">客服</a>-->
		<a id="collect">收藏</a>
		<a id="distribute">分享</a>
		<a id="study">开始学习</a>
		<a id="playing"><em></em><span></span></a>
	</div>
	<!-- end="脚注" -->
	
	<!-- start="二维码面板" -->
	<div class="block13"></div>
	<!-- end="二维码面板" -->
	
	<!-- start="分享图片代码" -->
	<div id="course-view-share-html" class="share-html">
		<div class="frame">
			<div class="border">
				<h1><img src="<%=Site[Logo]%>"><%=Site[Name]%></h1>
				<p><img src="<%=Course[Picture]%>"></p>
				<h2><%=Course[Name]%></h2>
				<img src="" class="qr">
			</div>
		</div>
	</div>
	<!-- end="分享图片代码" -->
</div>
<script src="<%=CommonPath%>jquery/core3.js"></script>
<script src="<%=CommonPath%>html2canvas.min.js"></script>
<script src="<%=CommonPath%>aliui/ali.mobile.min.js"></script>
<script src="<%=JsPath%>common.js"></script>
</body>
</html>
